<extend name="Index:base" />
<block name="content">
                <div class="main-content">
                    <div class="breadcrumbs" id="breadcrumbs">
                        <!-- 面包屑导航 -->
                        <ul class="breadcrumb">
                            <li>
                                <i class="icon-home home-icon"></i>
                                <a href="{:U('Admin/Index/index')}">首页</a>
                            </li>
                            <li>
                                <a href="{:U('Admin/Accesslist/index')}">{$page['title']['prev']}</a>
                            </li>
                            <li class="active">
                                {$page['title']['current']}
                            </li>
                        </ul>
                    </div>

                    <div class="page-content">

                        <!-- 页面导航 -->
                        <div class="page-header">
                            <h1>
                                {$page['title']['current']}
                                <a class="btn btn-info btn-sm pull-right" href="{:U('Admin/Accesslist/index')}">
                                    <i class="icon-reply icon-only"></i>
                                </a>
                            </h1>
                        </div>

                        <div class="row" style="margin-top:35px;">
                            <div class="col-xs-12">
                                <form class="form-horizontal" role="form" action="{:U('Admin/Accesslist/updataAccess')}" method="post" enctype="multipart/form-data">
                                    <input type="hidden" name="id" value="{$Think.get.id}">
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label no-padding-right"> 权限名称 </label>
                                        <div class="col-sm-10">
                                            <input class="col-xs-10 col-sm-5" type="text" placeholder="请填写权限名称" value="{$data['title']}" name="title">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label no-padding-right"> 权限标识 </label>
                                        <div class="col-sm-10">
                                            <input class="col-xs-10 col-sm-5" type="text" placeholder="请填写权限标识" value="{$data['name']}" name="name">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label no-padding-right"> 附加条件 </label>
                                        <div class="col-sm-10">
                                            <input class="col-xs-10 col-sm-5" type="text" value="{$data['trem']}" name="condition">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label no-padding-right"> 是否启用 </label>
                                        <div class="col-sm-10">
                                            <label>
                                                <input id="access-tap" class="ace ace-switch ace-switch-6" type="checkbox" {$data['status']==1?"checked":""}>
                                                <span class="lbl"></span>
                                            </label>
                                        </div>
                                        <input id="access-status" type="hidden" name="status" value="{$data['status']}">
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label no-padding-right"> 所属模块 </label>
                                        <div class="col-sm-10" id="selparent">
                                            <div id="menu-0" class="col-xs-10 col-sm-2  no-padding">
                                                <select class="form-control" name="mid">
                                                    <foreach name="classes" item="vo">
                                                        <option value="{$vo['id']}" {$data['mid']==$vo['id']?"selected":""}>{$vo['moduleName']}</option>
                                                    </foreach>
                                                </select>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="clearfix form-actions">
                                        <div class="col-md-offset-2 col-md-10">
                                            <button class="btn btn-info" type="submit">
                                                <i class="icon-ok bigger-110"></i>
                                                提交
                                            </button>
                                            &nbsp; &nbsp; &nbsp;
                                            <button class="btn" type="reset">
                                                <i class="icon-undo bigger-110"></i>
                                                重置
                                            </button>
                                        </div>
                                    </div>
                                </form>
                            </div><!-- /.col -->
                        </div><!-- /.row -->
                    </div><!-- /.page-content -->
                </div><!-- /.main-content -->
</block>
<block name="privatejs">
    <script type="text/javascript">
        $(function(){
            //设置当前页面的菜单高亮显示 开始
            var nownav = '#sidebar a[href*=Accesslist]';
            var parentattr = $(nownav).parent().parent().attr("class");
            $(nownav).parent().addClass('active');
            if (parentattr == 'submenu') {
                $(nownav).parent().parent().parent().addClass('active open');
            };
            //设置当前页面的菜单高亮显示 结束
            $('#access-tap').click(function(){
                if ($('#access-status').val()==1) {
                    $('#access-status').val(0)
                }else{
                    $('#access-status').val(1)
                }
            });

        });
    </script>
</block>